import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:wanandroid_client/route/route_names.dart';
import 'package:wanandroid_client/route/route_pages.dart';
import 'package:wanandroid_client/theme/app_theme.dart';

class WanandroidApp extends StatelessWidget {
  const WanandroidApp({super.key});

  @override
  Widget build(BuildContext context) => _createUI();

  Widget _createUI() => ScreenUtilInit(
    builder: (context, child) {
      return AdaptiveTheme(
        debugShowFloatingThemeButton: false,
        light: AppTheme.light,
        initial: AdaptiveThemeMode.light,
        builder: (ThemeData light, ThemeData dark) {
          return GetMaterialApp(
            title: 'Wanandroid-client',
            getPages: RoutePages.routes,
            theme: light,
            darkTheme: dark,
            // initialRoute: RouteNames.counterPage,
            initialRoute: RouteNames.mainPage,
            builder: EasyLoading.init(),
          );
        },
      );
    },
  );
}
